#ifndef USERDATA_H
#define USERDATA_H

#include <QObject>
#include <QSharedPointer>
#include "PaFile.h"

class UserData : public QObject
{
    Q_OBJECT
public:    
    static void config(const QString &name, const QString &path);
    static PaFile& get(const QString &name);
    static PaFile& system();
    static PaFile& app();

private:
    static UserData *instance();
    explicit UserData(QObject *parent = nullptr);
    void config_(const QString &name, const QString &path);
    PaFile& get_(const QString &name);

private:
    static UserData *_instance;
    QMap<QString,QSharedPointer<PaFile>> _nameToFile;
};

#endif // USERDATA_H
